package _04多态案例;

import java.util.Map;

public class Computer {

    public void userDevice(Usb usb){

        usb.connect();
        if (usb instanceof Mouse){
            Mouse mouse = (Mouse) usb;
            mouse.click();
        }

        if (usb instanceof KeyBoard){
            KeyBoard keyBoard = (KeyBoard) usb;
            keyBoard.input();
        }

        usb.exit();

    }
}
